home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / SCREEN / INDICATR.PAS < prev    next >
Pascal/Delphi Source File  |  1996-08-16  |  2KB  |  66 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; bouncing indicators
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBINI, EFLIBBAS, EFLIBOBJ, EFLIBIO, EFLIBWIN, EFLIBMSE,
  10.      EFLIBKBD, EFLIBTXT, EFLIBSCR, CRT;
  11.  
  12. var Indicator1, Indicator2, Indicator3 : IndicatorObjectPointerType;
  13.     Window : WindowObjectType;
  14.     Bounce : integer;
  15.  
  16.  
  17. begin
  18.      Screen.Draw;
  19.  
  20.      { Show a information window ... }
  21.      with Window do begin
  22.           Initialize;
  23.           SetHeader ('Bouncing indicators');
  24.           SetBorder (ThinBorder);
  25.           DisableExplode; EnableKeep; DisableCloseButton;
  26.           SetCoordinates (5, 2, 52, 9);
  27.           SetTextCoordinates (7, 3, 50, 8);
  28.           Draw;
  29.  
  30.           WriteLn ('@Yellow:Blue@@C@Indicators are visual objects that show');
  31.           WriteLn ('@C@the position inside an output.');
  32.           LineFeed;
  33.           WriteLn ('@LightGreen:Blue@@C@EFLIB opens an entire new world of');
  34.           Write   ('@C@programming!');
  35.           Intercept;
  36.      end;
  37.  
  38.      { Create three indicators - one of each kind }
  39.      New (Indicator1, Initialize (5, 12, 54, 12, 1, 100));
  40.      New (Indicator2, Initialize (2, 23, 79, 23, 1, 100));
  41.      New (Indicator3, Initialize (60, 2, 60, 21, 1, 100));
  42.  
  43.      Screen.HideCursor;
  44.      Indicator1^.Draw; Indicator2^.Draw; Indicator3^.Draw;
  45.  
  46.      with Mouse, Keyboard do repeat
  47.            { Bounce indicators ... }
  48.            for Bounce := 1 to 100 do begin
  49.                Delay(5);
  50.                Indicator1^.Update (Bounce);
  51.                Indicator2^.Update (Bounce);
  52.                Indicator3^.Update (Bounce);
  53.                if KeyPressed or ButtonPressed then Break;
  54.            end;
  55.            for Bounce := 100 downto 1 do begin
  56.                Delay(5);
  57.                if KeyPressed or ButtonPressed then Break;
  58.                Indicator1^.Update (Bounce);
  59.                Indicator2^.Update (Bounce);
  60.                Indicator3^.Update (Bounce);
  61.            end;
  62.      until KeyPressed or ButtonPressed;
  63.  
  64.      { Dispose objects }
  65.      Indicator1^.Free; Indicator2^.Free; Indicator3^.Free;
  66. end.